﻿//-----------------------------------------------------------------------
// <copyright file="ConfigInformation.cs" company="HCL">
//     Copyright (c) HCL Technologies.  All rights reserved.
// </copyright>
// <summary>
// Class for the config information
// </summary>
//-----------------------------------------------------------------------
namespace HCLT.Practice.WindowsAzure.Solution.STSAuthentication
{
    using System.Configuration;

    /// <summary>
    /// This class will read the configuration files and return the values
    /// </summary>
    public class ConfigInformation
    {
        /// <summary>
        /// sts urlfor application
        /// </summary>
        private static string stsUrl;

        /// <summary>
        /// active directory claim type
        /// </summary>
        private static string[] activeDirectoryClaimTypes;

        /// <summary>
        /// default domain
        /// </summary>
        private static string defaultDomain;

        /// <summary>
        /// Initializes static members of the ConfigInformation class 
        /// </summary>
        static ConfigInformation()
        {
            stsUrl = ConfigurationManager.AppSettings.Get("StsUrl");
            activeDirectoryClaimTypes = ConfigurationManager.AppSettings.Get("ClaimTypes").Split(',');
            defaultDomain = ConfigurationManager.AppSettings.Get("DefaultDomain");
        }

        /// <summary>
        /// Gets the default domain
        /// </summary>
        public static string DefaultDomain
        {
            get { return ConfigInformation.defaultDomain; }
        }

        /// <summary>
        /// Gets the sts urlfor application
        /// </summary>
        public static string StsUrl
        {
            get { return stsUrl; }
        }

        /// <summary>
        /// Gets the active directory claim type
        /// </summary>
        public static string[] ActiveDirectoryClaimTypes
        {
            get { return activeDirectoryClaimTypes; }
        }
    }
}